<!DOCTYPE html>
<html>
<head>
	<title>编辑-修改内容</title>
	<meta charset="utf-8">
	<meta name="referrer" content="never">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1,maximum-scale=1,user-scalable=no" />
	<meta content="yes" name="apple-mobile-web-app-capable">
	<meta content="yes" name="apple-touch-fullscreen">
	<meta content="telephone=no,email=no" name="format-detection">
	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/normalize.css" type="text/css">
	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/list.css" type="text/css">
	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/edit_regain.css" type="text/css">
	<link rel="stylesheet" type="text/css" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/tipdisapply.css">


	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/AmazeUI/assets/css/amazeui.min.css">
	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/common.css?v={$WST_V}">
	<link rel="stylesheet" href="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/css/orders_management.css?v={$WST_V}">


	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/jquery-1.7.2.min.js"></script>
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/scroll.js"></script>
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/qrjs2.min.js"></script>
	<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/jisuan.js"></script>
	<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/list.js"></script>
	<style type="text/css">
		@font-face {
			font-family: ae_Rasheeq-Bold;
			src:url('http://www.youyiku-yishu.cn/Apps/WebApp/View/default/fonts/234-CAI978.ttf') format('truetype');
			font-weight: normal;
			font-style: normal;
		}

		.return_right,.return_center{
			width:1.466667rem;
			height:0.586667rem;
			float: right;
		}
		.return_left{
			width:2.133333rem;
			height:0.586667rem;
			float: right;
			position: relative;
		}
		.uploadfile-input {
			opacity: 0;
			width: 100% !important;
			font-size: 0.58rem !important;
			position: absolute;
			top:0;
			left:0;
		}
		.regain_container,.regain_zhao{
			position: relative;
		}
		.img_float{
			position: relative;
			float: left;
		}
		fieldset{
			border:0;
			margin-bottom:0;
		}
		.am-panel-default{
			border:0;
		}
		.am-with-fixed-header{
			padding-top:0;
		}
		.regain_header{
			height:auto;
			overflow: hidden;
		}
		.regain_header_center{
			height:auto;
			width:auto;
		}
		.am-panel{
			box-shadow: none;
			margin-bottom:0;
		}
		.am-panel-bd{
			padding:0;
		}
		.complains-container{
			padding-top:0;
		}
		.year{
			margin-bottom: 0;
		}
		ul{
			padding-left: 0;
		}
		.bookZhao{
			width:100%;
			height:100%;
			top:0;
			left:0;
			z-index:2;
			position:absolute;
			display: none;
		}
		.bookBack{
			width:100%;
			height:100%;
			background: #000;
			opacity: 0.5;
			z-index: 5;
		}
		.zhaoImg{
			width:0.86rem;
			height:0.72rem;
			position: absolute;
			top:50%;
			left:50%;
			z-index: 6;
			color:#fff;
			margin-left:-0.43rem;
			margin-top:-0.36rem;

		}
		.img{
			width:100%;
			height:100%;
		}

		.photo{
			width:100%;
			height:100%;
			position: fixed;
			z-index:9999;
			bottom: 0;
			left:0;
		}
		.photo_container{
			width:200px;
			height:120px;
			background:#fff;
			position: absolute;
			z-index:9999;
			top:50%;
			left:50%;
			margin-left:-100px;
			margin-top:-60px;
			border-radius: 5px;
		}
		.photo_zhao{
			width:100%;
			height:100%;
			background:#9D9D9D;
			opacity: 0.5;
		}
		.photo_top{
			width:100%;
			height:69px;
			border-bottom: 1px solid #ddd;
			color:#9D9D9D;
			line-height: 70px;;
			text-align: center;
		}
		.photo_left{
			width:99px;
			height:50px;
			border-right: 1px solid #ddd;
			line-height: 50px;
			text-align: center;
			color:#9D9D9D;
			float: left;
		}
		.photo_right{
			border-right:0;
		}
		.photo_color{
			color:#0e8ee7;
		}
		.return_center{
			margin-right: 0.8rem;
		}
		.return_left {
			float: left;
		}
		.return_center_color{
			opacity: 0.6;
		}
		.deletetext{
			/*padding:0.4rem 0.15rem;*/
			width:6.153333rem;
			z-index: 2;
			opacity: 0;
			position: absolute;
			top: 0;
			left: 0;
			background-color: #000;
			overflow: hidden;
		}
		.deletetext img {
			width: 50%;
			display: block;
			position: absolute;
            top:50%; 
            left:50%;
            transform: translate(-50%,-50%);
		}
	</style>

</head>
<body>
<input type="hidden" id="getMonth" value="{$month}">
<div class="container">
	<div class="list_time">
		<div class="list_time_center">
			<div class="list_top">
				<div class="list_text">
					<div class="list_text_top clear">
						<div class="text_list"><h5>目录</h5></div>
						<div class="text_img"><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_close_icon.png" style="width:1.6rem;height:1.6rem;"></div>
					</div>
					<div class="feng" onclick="qqbook(this)">封面
					</div>
				</div>
				<div class="time">

					<div class="time_num">
						<foreach name="err" item="vo" key="ko">
							<ul class="clear">
								<h4 class="year">{$vo.createTime}年</h4>
								<if condition="in_array($vo['createTime'].'-01',$grr)"><li class="month"><input value="b{$vo.createTime}-01" style="display:none">1月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-01" style="display:none">1月</li></if>
								<if condition="in_array($vo['createTime'].'-02',$grr)"><li class="month"><input value="b{$vo.createTime}-02" style="display:none">2月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-02" style="display:none">2月</li></if>
								<if condition="in_array($vo['createTime'].'-03',$grr)"><li class="month"><input value="b{$vo.createTime}-03" style="display:none">3月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-03" style="display:none">3月</li></if>
								<if condition="in_array($vo['createTime'].'-04',$grr)"><li class="month"><input value="b{$vo.createTime}-04" style="display:none">4月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-04" style="display:none">4月</li></if>
								<if condition="in_array($vo['createTime'].'-05',$grr)"><li class="month"><input value="b{$vo.createTime}-05" style="display:none">5月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-05" style="display:none">5月</li></if>
								<if condition="in_array($vo['createTime'].'-06',$grr)"><li class="month"><input value="b{$vo.createTime}-06" style="display:none">6月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-06" style="display:none">6月</li></if>
								<if condition="in_array($vo['createTime'].'-07',$grr)"><li class="month"><input value="b{$vo.createTime}-07" style="display:none">7月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-07" style="display:none">7月</li></if>
								<if condition="in_array($vo['createTime'].'-08',$grr)"><li class="month"><input value="b{$vo.createTime}-08" style="display:none">8月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-08" style="display:none">8月</li></if>
								<if condition="in_array($vo['createTime'].'-09',$grr)"><li class="month"><input value="b{$vo.createTime}-09" style="display:none">9月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-09" style="display:none">9月</li></if>
								<if condition="in_array($vo['createTime'].'-10',$grr)"><li class="month"><input value="b{$vo.createTime}-10" style="display:none">10月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-10" style="display:none">10月</li></if>
								<if condition="in_array($vo['createTime'].'-11',$grr)"><li class="month"><input value="b{$vo.createTime}-11" style="display:none">11月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-11" style="display:none">11月</li></if>
								<if condition="in_array($vo['createTime'].'-12',$grr)"><li class="month"><input value="b{$vo.createTime}-12" style="display:none">12月</li><else/><li class="month nonemonth_color"><input class="months" value="b{$vo.createTime}-12" style="display:none">12月</li></if>
							</ul></foreach>
					</div>
				</div>
			</div>
			<div class="list_bot">
			</div>
		</div>
	</div>
	<div class="regain_yes_top">
		<foreach name="frr" item="v" key="k">
			<div class="regain_main {:$v['createTime']}">
				<div class="regain_header clear">
					<div class="regain_header_left">
						<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_calendar_icon_nor.png" style="width:100%;height:100%;">
					</div>
					<div class="regain_header_center" id="b{:$v['createTime']}">{:current(explode("-",$v['createTime']))}年</div>
					<div class="regain_header_right" onclick="ChooseMonth('{$v.createTime}','{$v.count}')">删除整个月</div>
				</div>
				<input type="hidden" class="nextTime" value="{$nextTime}">
				<foreach name="crr" item="vo" key="ko">
					<if condition="$v['createTime'] eq $vo['yearMonth']">
						<div class="regain_yes_main {$vo['id']}" >
							<div class="regain_radius">
								<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_round_icon.png" style="width:100%;height:100%;">
							</div>
							<div class="regain_main_center">
								<div class="regain_year one">
									<foreach name="frr" item="vb" key="kb" >
										<if condition="date('Y-m',$vo['createTime']) eq $vb['createTime']"><div class="b{:$vb['createTime']}"></div><else/></if></foreach>
									<strong style="font-family: ae_Rasheeq-Bold;font-size: 0.746667rem;color: #282828;">{:date("d",$vo['createTime'])}</strong>
									<i style="font-style:normal;font-family: PingFangSC-Light;font-size: 0.373333rem;color: #282828;padding-left:0.186667rem;">{:date("m",$vo['createTime'])}月</i>
								</div>
								<div class="regain_text">
									<div class="regain_container">
										<if condition="$vo['content']">
											<div class="regain_zhao">
												<div class="deletetext"><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" alt=""></div>
												<textarea disabled="disabled" class="regain_null img_none ll">{$vo['content'][0]}</textarea>
												<input type="hidden" name="qqbook" value="{$vo['id']}">
											</div><else/></if>
									</div>

									<div class="regain_text_img imgSort_{$v.createTime}_{$ko}">
										<input class="getid" value="{$vo.id}" style="display:none">
										<foreach name="vo.images" item="vs" key="ks">
										<div class='img_float'>
											<img onclick="deletepic('{$ks}','{$vo.id}',this)"  class="Trash" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" style="width:2.0rem;height:2.0rem;position:absolute;z-index:3;">
											<if condition="strpos($vs['0'],'pload') eq false">
												<img src="{$vs['0']}" style="width:2.0rem;height:2.0rem;" class="imgInfo_{$ko} wecharImg">
											<else/><img src="http://www.youyiku-yishu.cn/{$vs['0']}" style="width:2.0rem;height:2.0rem;" class="imgInfo_{$ko} wecharImg"></if>
										</div>
										</foreach>
										<if condition="$vo.vedio neq null">
										<input type="hidden" class="videocount" value="{$ko}">
										<div class='img_float vedio' class="videobox{$ko}">
											<img onclick="deletevideo('{$vo.id}',this)" class="Trash" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" style="width:2.0rem;height:2.0rem;position:absolute;z-index:3;">
											<div class="erWeiMa wecharImg" data-url="{$vo['vedio'][0]}" style="width:2.0rem;height:2.0rem;"></div>
										</div>
										</if>
									</div>
								</div>

								<div class="complains-container">
									<section class="am-panel am-panel-default">
										<div class="am-panel-bd" style="padding-left:0;padding-right:0;">
											<div class="return">
												<div class="return_right" onclick="Choose('{$vo.id}','{$vo.createTime}',this)">
													<i class="panduan" id="tips_{$ko}" style="font-style:normal;display:inline-block;float:right;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">删除</i><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_delete_icon_nor.png" style="width:0.586667rem;height:0.586667rem;float:right;">
												</div>
												<div class="return_center">
													<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_edit_the_text_icon_sel.png" style="width:0.586667rem;height:0.586667rem;float:left;">
													<i style="font-style:normal;display:inline-block;float:left;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">编辑</i>
												</div>
												<if condition="$vo.vedio eq null">
												<div class="return_left" class="newWxUpload" data-id="{$ko}" onclick="chooseImg('{$v.createTime}',this)">
													<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_add_to_photo_icon_nor.png" style="width:0.586667rem;height:0.586667rem;float:left;">
													<i style="font-style:normal;display:inline-block;float:left;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">添加图片</i>
												</div>
												</if>
											</div>
											<form class="am-form" style="diaplay:none">
												<fieldset>
													<div class="am-form-group am-form-file">
														<div style="clear:both;"></div>
													</div>
												</fieldset>
											</form>
										</div>
									</section>
								</div>
							</div>
						</div>
					</if>
				</foreach>

			</div>
			</foreach>


		<input class="jumpmonth" type="hidden" value="{$month1}">
		<div class="regain_yes_bot">
			<div class="regain_bottom">
				<div class="regain_yes_bag">
				</div>
				<div class="regain_yes_left">
					<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/regain_back.png" style="width:100%;height:100%;">
				</div>
				<div class="regain_yes_center">
					<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/wechat_ book_edit_catalog_icon_nav_nor.png" style="width:1.013333rem;height:1.013333rem;margin:-0.106667rem auto;"><br><a style="line-height:0.746667rem;font-family:PingFangSC-Semibold;font-size: 10px;color: #5BC7B8;">目录</a>
				</div>
				<div class="regain_yes_right" id="sure">
					<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/regain_yes.png" style="width:100%;height:100%;">
				</div>
			</div>
		</div>
	</div>
</div>

</div>
</body>


<include file="./Apps/WebApp/View/default/common_js.html" />
<script src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/Photoclip/iscroll-zoom.js"></script>
<script src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/Photoclip/hammer.js"></script>
<script src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/Photoclip/jquery.photoClip.js"></script>
<!--<script src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/order_complains.js?v={$WST_V}"></script>-->

<script>
	function erweima(url,obj){
		
		createErweima(url,obj);
		//需要qrjs2.min.js
		function createErweima(url,obj){
			//console.log(url,obj);
			var container1 = $(obj);
			var svgElement = document.createElement("div"),

				u = url,
				s = QRCode.generateSVG(u, {
					ecclevel: "M",
					fillcolor: "#FFFFFF",
					textcolor: "#373737",
		//						margin: 4,
		//						modulesize: 4
				});
			svgElement.appendChild(s);
			container1.append(svgElement);
		}	
	}
	$(".erWeiMa").each(function(){
		var url = $(this).data("url");
		erweima(url,this);
	})
	
	$('textarea').each(function () {
		this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
		$(this).prev().css("height",(this.scrollHeight)+"px");
	}).on('input', function () {
		this.style.height = 'auto';
		this.style.height = (this.scrollHeight) + 'px';
	});

	var i=0;

	function add(url,ym,dataId){
		var id=$('.imgSort_'+ym+"_"+dataId).find('input').val();
//		alert(id);
		$.ajax({
			type: "get",//数据发送的方式（post 或者 get）
			url: " {:U('QqBooks/uploadimg')}",//要发送的后台地址
			data:{'k':id,'img':url},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
			dataType: "json",//后台处理后返回的数据格式
			success:function(data){
//				alert(JSON.stringify(data))
//				window.location.reload()
				if(data.status==-1){


					setTimeout(function(){
						$('<div>').appendTo('body').addClass('alert alert-success').html('已经超过9张图了').show().delay(1500).fadeOut();
							//超过9张的  删掉
							var img_float = data.count;
							for(var i=img_float-1;i>9;i--){
								$('.imgSort_'+ym+"_"+dataId).find(".img_float").eq(i).remove();
							}  
					},1000)
					$('.imgSort_'+dataId).children('div:last').remove();
				}
				if(data.status==1){
					$('<div>').appendTo('body').addClass('alert alert-success').html('上传成功').show().delay(1500).fadeOut();
				}

			}
		})
	}
</script>

<script>
	function ChooseMonth(time,count){
		var cratetime=String(time);
      	var Time1 =cratetime.replace(".", "-");
      	console.log(Time1);
		$.ajax({
			type: "get",//数据发送的方式（post 或者 get）
			url: " {:U('QqBooks/deletemonth')}",//要发送的后台地址
			data:{'time':time,'count':count},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
			dataType: "json",//后台处理后返回的数据格式
			success:function(data){
//        		$('.'+time).remove();
				 var cccc=$('.'+Time1).remove()
			}
		})
	};

	function removeClass(element,classRomove){
		var classNames = " "+element.className+" ";
		classNames = classNames .replace(" "+classRomove+" ", " ");
		element.className = classNames;
	}

	function Choose(id,time,params){
		var id=id;
	    var Parent=  $('.'+id).parent();
	    console.log( Parent)
	    var sublevel=Parent.children('.regain_yes_main').length;
	     if(sublevel==1){
	     	Parent.remove();
	     }
		var text=$(params).children().text();
		if(text=='删除'){
			$.ajax({
				type: "get",//数据发送的方式（post 或者 get）
				url: " {:U('QqBooks/delete')}",//要发送的后台地址
				data:{'id':id,'time':time},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
				dataType: "json",//后台处理后返回的数据格式
				success:function(data){	
			    $('.'+id).remove();
			
				}
			})
		}
		else{
			$.ajax({
				type: "get",//数据发送的方式（post 或者 get）
				url: " {:U('QqBooks/recoverpart')}",//要发送的后台地址
				data:{'id':id,'time':time},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
				dataType: "json",//后台处理后返回的数据格式
				success:function(data){
//				alert(JSON.stringify(data))
					window.location.reload()
				}
			})
		}
	};

	function deletepic(ks,id,params){
//		console.log(ks,id);
		var bb= $(params).parent().parent().parent().next().children().children().children('.return').children('.return_right');
		bb.children('i').text('恢复');
		var aa=$(params).parent().parent().parent().parent().parent();
//		console.log(aa)
//		console.log(ks,time);
		$.ajax({
			type: "get",//数据发送的方式（post 或者 get）
			url: " {:U('QqBooks/deletepart')}",//要发送的后台地址
			data:{'ks':ks,'id':id},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
			dataType: "json",//后台处理后返回的数据格式
			success:function(data){
//				console.log(data);
				var code = data.code;
				var a = $(params).parent().parent().parent().prev().find("regain_null"); //找出文本是否在
				var b = $(params).siblings();  //找出他同级的存在状态
//				console.log(a,b);
				if(code==0){

					aa.remove();
				}else if(code==1){
//					$(params).parent().remove();
				}else{
					console.log("报错,请调试代码");
				}
			}
		})
	};

	function deletevideo(id,obj){
		var aa=$(obj).parent().parent().parent().parent().parent();

		$.ajax({
			type: "get",//数据发送的方式（post 或者 get）
			url: " {:U('QqBooks/deletevedio')}",//要发送的后台地址
			data:{'id':id},//要发送的数据（参数）格式为{'val1':"1","val2":"2"}
			dataType: "json",//后台处理后返回的数据格式
			success:function(data){

				if(data.code==0){ //文本不存在
					aa.remove()
				}else{
					$(obj).parent().parent().remove();
				}
			}
		})
	};

</script>

<script>
	var WST = ThinkPHP = window.Think = {
		"ROOT"   : "__ROOT__",
		"APP"    : "__APP__",
		"PUBLIC" : "__PUBLIC__",
		"DEEP"   : "{:C('URL_PATHINFO_DEPR')}",
		"MODEL"  : ["{:C('URL_MODEL')}", "{:C('URL_CASE_INSENSITIVE')}", "{:C('URL_HTML_SUFFIX')}"],
		"VAR"    : ["{:C('VAR_MODULE')}", "{:C('VAR_CONTROLLER')}", "{:C('VAR_ACTION')}"],
		"DOMAIN" : "{:WSTDomain()}",
		"CITY_ID" : "{$currArea['areaId']}",
		"CITY_NAME" : "{$currArea['areaName']}",
		"DEFAULT_IMG": "{:WSTDomain()}/{$CONF['goodsImg']}",
		"MALL_NAME" : "{$CONF['mallName']}",
		"SMS_VERFY"  : "{$CONF['smsVerfy']}",
		"PHONE_VERFY"  : "{$CONF['phoneVerfy']}",
		"IS_LOGIN" :"{$WST_IS_LOGIN}",
		"WST_STYLE" :"{$WST_STYLE}"
	}
	function qqbook(params){
		location.href = WST.U("WebApp/QqxBooks/qqbook");
	}
	$('.regain_yes_left').click(function(){
		window.history.back(-1)
	})
</script>

<script type="text/javascript" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/js/list.js"></script>
<script src="http://www.youyiku-yishu.cn/Public/js/think.js"></script>
<script>
	var nextTimeClick = "";
	$(function(){
		var data=$('#sure').attr('data');
		$(".month").each(function(){		
			var b_ym = $(this).find("input").val();
			b_ym = b_ym.slice(1,8);
			$(this).find("input").val(b_ym);
		})
		$('.month').click(function(){
			var a=$(this).find('input').val();		
			data=a;
			//console.log(data);
			if( $('.b'+data).length !== 0 ){
				//加载过的    真正移动的方法
				$("body").removeClass('gfixed');

				$('html, body').animate({
					scrollTop: $('.b'+data).offset().top
				}, 500);
			}else{
				$(".regain_main").remove();
				//如果没有加载过
				$.post(Think.U('WebApp/QqBooks/printYMcontent'),{ym:data},function(json){
//					alert(JSON.stringify(json));
					console.log(json);
					cont = true;
					var content = json.content;
					var y = json.ym.slice(0,4);
					var m = json.ym.slice(5,7);
					nextTimeClick = json.next;
//					console.log(nextTimeClick);
					var str = "";
					var str1 = "";
					if(json.status==1){
						str += '<div class="regain_main '+json.ym+'">';
						str += '<div class="regain_header clear">';
						str += '<div class="regain_header_left">';
						str += '<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_calendar_icon_nor.png" style="width:100%;height:100%;">';
						str += '</div>';
						str += '<div class="regain_header_center" id="b'+json.ym+'">'+json.ym.slice(0,4)+'年</div>';
						str += '<div class="regain_header_right" onclick="ChooseMonth('+y.concat(".",m)+','+content.length+')">删除整个月</div>';
						str += '</div>';
						str += '<input type="hidden" class="nextTime" value="'+json.next+'">';
						$(".regain_yes_top").append(str);
					}

					for(var i=0;i<content.length;i++){
						str1 += '<div class="regain_yes_main '+content[i].id+'" >'+
							'<div class="regain_radius">'+
								'<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_round_icon.png" style="width:100%;height:100%;">'+
							'</div>'+
							'<div class="regain_main_center">'+
								'<div class="regain_year one">'+
									'<div class="b'+json.ym+'"></div>'+
									'<strong style="font-family: ae_Rasheeq-Bold;font-size: 0.746667rem;color: #282828;">'+content[i].d+'</strong>'+
								'<i style="font-style:normal;font-family: PingFangSC-Light;font-size: 0.373333rem;color: #282828;padding-left:0.186667rem;">'+content[i].m+'月</i>'+
								'</div>'+
								'<div class="regain_text">'+
									'<div class="regain_container">'+
										'<div class="regain_zhao">';
									if(content[i].text == "" ||content[i].text == 'null'){
										str1 +=	'';
									}else{
										str1 += '<div class="deletetext"><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" alt=""></div>';
										str1 +=	'<textarea disabled="disabled" class="regain_null img_none ll">'+content[i].text+'</textarea>';
									}
						str1 +=				'<input type="hidden" name="qqbook" value="'+content[i].id+'">'+
										'</div>'+
									'</div>'+
									'<div class="regain_text_img imgSort_'+json.ym+'_'+i+'">'+
										'<input class="getid" value="'+content[i].id+'" style="display:none">'+
										imginfo(content[i].imgs,content[i].id,i)+
										isHavevedio(content[i],i)+
									'</div>'+
								'</div>'+
								'<div class="complains-container">'+
									'<section class="am-panel am-panel-default">'+
										'<div class="am-panel-bd" style="padding-left:0;padding-right:0;">'+
											'<div class="return">'+
												'<div class="return_right" onclick="Choose('+content[i].id+','+content[i].date+',this)">'+
													'<i class="panduan" id="tips_'+i+'" style="font-style:normal;display:inline-block;float:right;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">删除</i><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_delete_icon_nor.png" style="width:0.586667rem;height:0.586667rem;float:right;">'+
												'</div>'+
												'<div class="return_center">'+
													'<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_edit_the_text_icon_sel.png" style="width:0.586667rem;height:0.586667rem;float:left;">'+
													'<i style="font-style:normal;display:inline-block;float:left;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">编辑</i>'+
												'</div>'+

												'<div class="return_left" onclick="chooseImg('+y.concat(".",m)+',this)" class="newWxUpload" data-id="'+i+'">'+
													'<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_add_to_photo_icon_nor.png" style="width:0.586667rem;height:0.586667rem;float:left;">'+
													'<i style="font-style:normal;display:inline-block;float:left;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">添加图片</i>'+
												'</div>'+
											'</div>'+
											'<form class="am-form" style="diaplay:none">'+
												'<fieldset>'+
													'<div class="am-form-group am-form-file">'+
														'<div style="clear:both;"></div>'+
													'</div>'+
												'</fieldset>'+
											'</form>'+
										'</div>'+
									'</section>'+
								'</div>'+
								
							'</div>'+
						'</div>'
					}
					$(".regain_main:last").append(str1);
					$(".regain_main").each(function(){
						if( $(this).find(".regain_header_center").attr("id") === "b" ){
							//console.log("该删掉!");
							$(this).remove();
						}
					})			
					$('textarea').each(function () {
						this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
						$(this).prev().attr("style",'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
					}).on('input', function () {
						this.style.height = 'auto';
						this.style.height = (this.scrollHeight) + 'px';
						$(this).prev().css("height",(this.scrollHeight)+"px");
					});
					$(".erWeiMa").each(function(){
						var url = $(this).data("url");
						erweima(url,this);
					})

					textInputOrBlur();
				})
			}	
		});
		$('#sure').click(function(){
			location.href = WST.U("WebApp/QqBooks/qqbook");
		})
	})

	var cont = true;
	$(window).scroll(function(){
	　　var scrollTop = $(this).scrollTop();
	　　var scrollHeight = $(document).height();
	　　var windowHeight = $(this).height();
		var oneHeight = $(".regain_yes_main").eq(0).innerHeight()*2;
	　　if(cont && scrollTop + windowHeight + oneHeight >= scrollHeight){
			cont = false;
		  if(nextTimeClick){
			  var nextTime = nextTimeClick;
			  nextTimeClick = "";
		  }else{
			  var nextTime = $(".nextTime:last").val();
		  }
//		  console.log("nextTime:"+nextTime);
			if(nextTime==="null"){
				$('<div>').appendTo('body').addClass('alert alert-success').html('已经到最底部了！').show().delay(1500).fadeOut();
				$(".regain_main").each(function(){
					if( $(this).find(".regain_header_center").attr("id") === "b" ){
						//console.log("该删掉!");
						$(this).remove();
					}
				})			
			}else{
				$.post(Think.U('WebApp/QqBooks/printYMcontent'),{ym:nextTime},function(data){
					console.log(data);
					cont = true;
					var content = data.content;
					var y = data.ym.slice(0,4);
					var m = data.ym.slice(5,7);
//					console.log(y,m);
					var str = "";
					var str1 = "";
					str += '<div class="regain_main '+data.ym+'">';
					str += '<div class="regain_header clear">';
					str += '<div class="regain_header_left">';
					str += '<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_calendar_icon_nor.png" style="width:100%;height:100%;">';
					str += '</div>';
					str += '<div class="regain_header_center" id="b'+data.ym+'">'+data.ym.slice(0,4)+'年</div>';
					str += '<div class="regain_header_right" onclick="ChooseMonth('+y.concat(".",m)+','+content.length+')">删除整个月</div>';
					str += '</div>';
					str += '<input type="hidden" class="nextTime" value="'+data.next+'">';
					$(".regain_yes_top").append(str);

					for(var i=0;i<content.length;i++){
						
						str1 += '<div class="regain_yes_main '+content[i].id+'">'+
								'<div class="regain_radius">'+
									'<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_restore_content_timeline_round_icon.png" style="width:100%;height:100%;">'+
								'</div>'+
								'<div class="regain_main_center">'+
								'<div class="regain_year one">'+
										'<div class="b'+data.ym+'"></div>'+				
										'<strong style="font-family: ae_Rasheeq-Bold;font-size: 0.746667rem;color: #282828;">'+content[i].d+'</strong>'+
									'<i style="font-style:normal;font-family: PingFangSC-Light;font-size: 0.373333rem;color: #282828;padding-left:0.186667rem;">'+content[i].m+'月</i>'+
								'</div>'+
								'<div class="regain_text">'+
									'<div class="regain_container">'+
										'<div class="regain_zhao">';
								if(content[i].text == "" ||content[i].text == 'null'){
									str1 +=	'';
								}else{
									str1 += '<div class="deletetext"><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" alt=""></div>';
									str1 +=	'<textarea disabled="disabled" class="regain_null img_none ll">'+content[i].text+'</textarea>';
								}						
						str1 +=				'<input type="hidden" name="qqbook" value="'+content[i].id+'">'+
										'</div>'+
									'</div>'+
									'<div class="regain_text_img imgSort_'+data.ym+'_'+i+'">'+
										'<input class="getid" value="'+content[i].id+'" style="display:none">'+
										imginfo(content[i].imgs,content[i].id,i)+	
										isHavevedio(content[i],i)+		
									'</div>'+
								'</div>'+
								'<div class="complains-container">'+
									'<section class="am-panel am-panel-default">'+
										'<div class="am-panel-bd" style="padding-left:0;padding-right:0;">'+
											'<div class="return">'+
												'<div class="return_right" onclick="Choose('+content[i].id+','+content[i].date+',this)">'+
													'<i class="panduan" id="tips_'+i+'" style="font-style:normal;display:inline-block;float:right;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">删除</i><img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_delete_icon_nor.png" style="width:0.586667rem;height:0.586667rem;float:right;">'+
												'</div>'+
												'<div class="return_center">'+
													'<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_edit_the_text_icon_sel.png" style="width:0.586667rem;height:0.586667rem;float:left;">'+
													'<i style="font-style:normal;display:inline-block;float:left;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">编辑</i>'+
												'</div>'+

												'<div class="return_left" onclick="chooseImg('+y.concat(".",m)+',this);" class="newWxUpload" data-id="'+i+'">'+
													'<img src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_add_to_photo_icon_nor.png" style="width:0.586667rem;height:0.586667rem;float:left;">'+
													'<i style="font-style:normal;display:inline-block;float:left;line-height:0.586667rem;font-size: 0.32rem;color: #29A3DA;">添加图片</i>'+
												'</div>'+
											'</div>'+
											'<form class="am-form" style="diaplay:none">'+
												'<fieldset>'+
													'<div class="am-form-group am-form-file">'+
														'<div style="clear:both;"></div>'+
													'</div>'+
												'</fieldset>'+
											'</form>'+
										'</div>'+
									'</section>'+
								'</div>'+
								
							'</div>'+
						'</div>'
					}
					$(".regain_main:last").append(str1);
					$('textarea').each(function () {
						this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
						$(this).prev().attr("style",'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');

					}).on('input', function () {
						this.style.height = 'auto';
						this.style.height = (this.scrollHeight) + 'px';
					});
					textInputOrBlur();
					$(".erWeiMa").each(function(){
						var url = $(this).data("url");
						erweima(url,this);
					})

				})
			}
	　　}
	});

	//每一条信息带的图片;
	function imginfo(imgs,id,count){ //图片数组，创建时间，循环到第几次
		var str_imginfo = "";
		if(imgs==undefined){
			return str_imginfo;
		}else{
			for(var k=0; k<imgs.length; k++){
				if(imgs[k]!=''){
					if(imgs[k].toString().indexOf('pload')>0){
						imgs[k]='http://www.youyiku-yishu.cn/'+imgs[k]
					}
					str_imginfo+='<div class="img_float">'+
							'<img onclick="deletepic('+k+','+id+',this)" class="Trash"src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" style="width:2.0rem;height:2.0rem;position:absolute;z-index:3;">'+
							'<img src="'+imgs[k]+'" style="width:2.0rem;height:2.0rem;" class="imgInfo_'+count+' wecharImg">'+
							'</div>'
				}

			}
			return str_imginfo;
		}		
	}
	function isHavevedio(curContent,i){
		var str_vedio = "";
		//console.log(curContent.vedio);
		if(curContent.vedio){
			str_vedio += '<input type="hidden" class="videocount" value="'+i+'">'+
			'<div class="img_float vedio" class="videobox'+i+'">'+
				'<img  onclick="deletevideo('+curContent.id+',this)" class="Trash" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" style="width:2.0rem;height:2.0rem;position:absolute;z-index:3;">'+
				'<div class="erWeiMa wecharImg" data-url="'+curContent.vedio+'" style="width:2.0rem;height:2.0rem;"></div>'+
			'</div>';
			return str_vedio;
		}else{
			return "";
		}
	}
</script>
<script>
	window.onload = function(){
		var month1=$('.jumpmonth').val();
		if(month1){
			$("body").removeClass('gfixed');
			$('html,body').animate({
				scrollTop: $('.'+month1).offset().top
			}, 500);
		}
	}
</script>
<include file="./Apps/WebApp/View/default/common_js.html" />
<script>
	/*
	 * 注意：
	 * 1. 所有的JS接口只能在公众号绑定的域名下调用，公众号开发者需要先登录微信公众平台进入“公众号设置”的“功能设置”里填写“JS接口安全域名”。
	 * 2. 如果发现在 Android 不能分享自定义内容，请到官网下载最新的包覆盖安装，Android 自定义分享接口需升级至 6.0.2.58 版本及以上。
	 * 3. 常见问题及完整 JS-SDK 文档地址：http://mp.weixin.qq.com/wiki/7/aaa137b55fb2e0456bf8dd9148dd613f.html
	 *
	 * 开发中遇到问题详见文档“附录5-常见错误及解决办法”解决，如仍未能解决可通过以下渠道反馈：
	 * 邮箱地址：weixin-open@qq.com
	 * 邮件主题：【微信JS-SDK反馈】具体问题
	 * 邮件内容说明：用简明的语言描述问题所在，并交代清楚遇到该问题的场景，可附上截屏图片，微信团队会尽快处理你的反馈。
	 */
	wx.config({
		debug: false,
		appId: '<?php echo $signPackage["appId"];?>',
		timestamp: <?php echo $signPackage["timestamp"];?>,
	nonceStr: '<?php echo $signPackage["nonceStr"];?>',
			signature: '<?php echo $signPackage["signature"];?>',
			jsApiList: [
		// 所有要调用的 API 都要加到这个列表中
		'chooseImage','previewImage','uploadImage','downloadImage'
	]
	});
	var images = {
		localId: [],
		serverId: [],
		download:[]
	};
	var str='';
	wx.ready(function () {

	})
	function chooseImg(ym,obj){
		var dataId=$(obj).attr('data-id')
		
		var curNum=$(obj).parent().parent().parent().parent().prev().find('.imgInfo_'+dataId).length;
		var addNum=9-curNum;
//		alert(addNum)
		// 在这里调用 API
		if(addNum>0){
			wx.chooseImage({
				count:addNum, // 默认9
				sizeType: ['original', 'compressed'], // 可以指定是原图还是压缩图，默认二者都有
				sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
				success: function (res) {
//				var localIds = res.localIds; // 返回选定照片的本地ID列表，localId可以作为img标签的src属性显示图片
					images.localId = res.localIds;
					var i = 0, length = images.localId.length;
					images.serverId = [];
					function upload() {
						wx.uploadImage({
							localId: images.localId[i],
							success: function(res) {
								i++;
								images.serverId.push(res.serverId);
								//下载
								$.ajax({
									type:"post",
									async:false,
									url:WST.U('WebApp/WxBooks/newUploadBook'),
									data:{'media_id':res.serverId,"ym":ym},
									success:function(data){
										var json = WST.toJson(data);
										if(json.code==1){
											var str='';
											str+='<div class="img_float">'
											str+='<img  onclick="deletepic('+Number(i+curNum)+','+ym+',this)" class="Trash" src="http://www.youyiku-yishu.cn/Apps/WebApp/View/default/images/edit_modify_the_content_deleted_image.png" style="width:2.0rem;height:2.0rem;position:absolute;z-index:3;">';
											str+='<img src="'+json.aurl+'" style="width:2.0rem;height:2.0rem;" class="imgInfo_'+dataId+' wecharImg">'
											str+='</div>';
											$(obj).parent().parent().parent().parent().prev().find(".imgSort_"+json.ym+"_"+dataId).append(str);
											$('#tips_'+dataId).text('恢复')
											$('.img_float img:odd').on('touchend',function(){
												$('.img_float img:even').css('display','none');
												$(this).siblings().css('display','block');
											})
											$('.img_float img:even').on('click',function(){
												$(this).parent().remove();
											})
//											alert(JSON.stringify(json));
											add(json.purl,json.ym,dataId);
										}else{
											wstMsg('上传失败，请重试');
										}
									},
									error:function(res){
										alert(res);
									}
								})

								if(i < length) {
									upload();
								}
							},
							fail: function(res) {
//									alert(JSON.stringify(res));
							}
						});
					}
					upload();
				}
			});
		}else{
			setTimeout(function(){
				$('<div>').appendTo('body').addClass('alert alert-success').html('塞不进去啦！').show().delay(1500).fadeOut();
			},300)
		}
	}
</script>

</html>